package br.com.naybee.client.views.base;

import br.com.naybee.client.views.add.menu.automacao.MenuView;
import br.com.naybee.client.views.add.menu.login.LoginView;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;

public class HeadView extends Composite {

	private static HeadUiBinder uiBinder = GWT.create(HeadUiBinder.class);

	interface HeadUiBinder extends UiBinder<Widget, HeadView> {
	}

	@UiField
	protected HTMLPanel head;

	public HeadView() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiHandler("arrowLeft")
	public void onClickArrowLeft(ClickEvent clickEvent) {
		Principal.get().add(new MenuView());
	}

	@UiHandler("btnConfig")
	public void onClickBtnConfig(ClickEvent clickEvent) {
		Principal.get().add(new LoginView());
	}

	public void add(Widget widget) {
		head.clear();
		head.add(widget);
	}

}
